import pandas as pd

# 1.列表 创建DataFrame
data = [
    ["Alice", 10],
    ["Jack", 11],
    ["Tom", 12],
]
df = pd.DataFrame(data, columns=["Name", "Age"])
print(df)

# 2. 列类型指定 astype
df['Name'] = df['Name'].astype(str)
df['Age'] = df['Age'].astype(float)
# df['Age'] = df['Age'].astype(int)
print(df)

""" 
    Name  Age
0  Alice   10
1   Jack   11
2    Tom   12

    Name   Age
0  Alice  10.0
1   Jack  11.0
2    Tom  12.0
"""
